<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        window.onload=function(){
        var btn01=document.getElementById("btn01");
        var btn01=document.getElementById("btn01");
        btn01.onclick=function(){
            alert(1);
        }
        btn02.onclick=function(){
            alert(2);
        };
        /* 
            设置btn01对鼠标按下相关的事件进行捕获
            当调用一个元素的setCapture()方法以后，这个元素将会把下一次所欲的鼠标按下的相关的事件捕获到自己身上
            
        */
        btn01.setCapture();
        }
    </script>
</head>
<body>
   <button id="btn01"></button> 
   <button id="btn02"></button>
</body>
</html>